package ar.edu.unicen.exa.isistan.archassis.ia.api.impl;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import ar.edu.unicen.exa.isistan.archassis.ia.Result;
import ar.edu.unicen.exa.isistan.archassis.ia.api.JavaClassEvalResult;
import ar.edu.unicen.exa.isistan.archassis.ia.api.JavaClassListCasesEvalResult;
import ar.edu.unicen.exa.isistan.archassis.ia.comparator.AIResultSortByCumplido;

public class MySummaryData extends AbstractSummaryData {
	private List<Result> result;

	public MySummaryData(JavaClassEvalResult javaClassEvalResult) {
		super(javaClassEvalResult.getInputJavaClass());
		result = new ArrayList<Result>();
		for (JavaClassListCasesEvalResult javaClassListCasesEvalResult : javaClassEvalResult.getMap().values()) {
			Result r = new Result(javaClassEvalResult.getInputJavaClass(),
					javaClassListCasesEvalResult.getJavaClass(),
					javaClassListCasesEvalResult.getListCasesBean(),
					javaClassListCasesEvalResult.getHecho(),
					javaClassListCasesEvalResult.getSobra());
			result.add(r);
		}
		Collections.sort(result, new AIResultSortByCumplido());
	}

	@Override
	public List<Result> getListCase() {
		return result;
	}

}
